package com.qiaotongtianxia.loans.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.widget.NestedScrollView;

import com.qiaotongtianxia.loans.R;
import com.qiaotongtianxia.loans.functionInterface.IBaseRequestImp;
import com.qiaotongtianxia.loans.net.Api;
import com.qiaotongtianxia.loans.util.CommonUtils;
import com.qiaotongtianxia.loans.views.BaseTextView;
import com.qiaotongtianxia.loans.views.DragLayout;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by lisen on 2017/12/16.
 *
 * @author lisen < 4533548588@qq.com >
 */

public class RefundNoticeActivity extends BaseActivity implements DragLayout.DragListener{
    @BindView(R.id.tv_nav_title)
    BaseTextView tvNavTitle;
    @BindView(R.id.tv_msg)
    BaseTextView tvMsg;
    @BindView(R.id.scrollView)
    NestedScrollView scrollView;
    @BindView(R.id.dragLayout)
    DragLayout dragLayout;

    @Override
    public int getLayoutId() {
        return R.layout.activity_refund_notice;
    }

    @Override
    public void onBaseCreate(@Nullable Bundle savedInstanceState) {
        dragLayout.setListener(this);
        api.refundTip(new IBaseRequestImp<String>() {
            @Override
            public void onRequestSuccess(String s) {
                tvMsg.setText(s);
            }
        });
    }

    @Override
    public Api onApiCreate() {
        return new Api(this);
    }

    @OnClick(R.id.iv_nav_back)
    public void onViewClicked() {
        finish();
    }

    @Override
    public void initTitle() {
        tvNavTitle.setText(getString(R.string.manageNotice));
    }

    @Override
    public boolean isCanPullDown() {
        return CommonUtils.isReachTop(scrollView);
    }

    @Override
    public boolean isCanPullUp() {
        return CommonUtils.isReachBottom(scrollView);
    }
}
